Skip to content

Conversation

@willmaclean
Copy link
Contributor

Problem

The section filtering logic was incorrectly hiding 272 legitimate assessable code requirements from users.

The bug was in app/api/compliance/sections/route.ts where ALL sections ending in .1 were excluded, based on the assumption that they were all intro sections titled "General" or "Scope".

Impact

Users could not see or create checks for important requirements like:

  • 11B-404.2.1 - Revolving doors, gates and turnstiles
  • 11B-206.2.1 - Site arrival points
  • 11B-213.3.1.1 - Toilet compartments
  • 11B-407.4.1 - Car dimensions
  • And 268 more...

Root Cause Analysis

Database analysis revealed that of 388 sections ending in .1:

  • 116 sections (30%) are titled "General" or "Scope" → These ARE intro sections
  • 272 sections (70%) have specific titles → These are REAL REQUIREMENTS

Breakdown by depth:

Depth Intro (General/Scope) Specific Requirements Total
1 dot 105 (83%) 21 (17%) 126
2 dots 10 (6%) 155 (94%) 165
3+ dots 1 (1%) 96 (99%) 97

Solution

Changed from depth-based filtering to title-based filtering:

  • Only exclude sections ending in .1 that are titled "General" or "Scope"
  • Keep all sections with specific requirement titles

This precisely targets the 116 intro sections while preserving all 272 real requirements.

Testing

Verified against production database:

  • 116 intro sections correctly excluded
  • 272 specific requirement sections now visible
  • No false positives (confirmed "General seating" is kept)

…ntros

Previously, the filter excluded ALL sections where the number ended in .1,
which incorrectly hid 272 legitimate assessable requirements from users.

The old logic assumed all .1 sections were intro sections, but analysis shows:
- 116 sections (30%) are titled "General" or "Scope" - these ARE intro sections
- 272 sections (70%) have specific titles - these are REAL REQUIREMENTS

Examples of sections that were incorrectly hidden:
- 11B-404.2.1 "Revolving doors, gates and turnstiles"
- 11B-206.2.1 "Site arrival points"
- 11B-213.3.1.1 "Toilet compartments"
- 11B-407.4.1 "Car dimensions"

This fix uses title-based filtering instead of number-based filtering.
Only sections ending in .1 that are titled "General" or "Scope" are excluded.
All other sections ending in .1 with specific requirement titles are now visible.

Impact: Users can now see and assess 272 additional code requirements.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Oct 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
service Ready Ready Preview Comment Oct 16, 2025 4:55pm

@supabase
Copy link

supabase bot commented Oct 16, 2025

This pull request has been ignored for the connected project grosxzvvmhakkxybeuwu because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants